#ifndef AUDIOOBJECT_H
#define AUDIOOBJECT_H

#include <QDeclarativeItem>
#include <QString>
//#include "GEAudioBuffer.h"
#include "GEAudioBufferPlayInstance.h"

class AudioObject : public QDeclarativeItem
{
    Q_OBJECT

public:
    explicit AudioObject(QDeclarativeItem *parent = 0);
    ~AudioObject();

    Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
    QString source() { return m_Source; }
    void setSource(QString source);

    Q_INVOKABLE void play();
    Q_INVOKABLE void playWithLoop();
    Q_INVOKABLE void stop();

signals:
    void sourceChanged(const QString &value);

private:
    QString m_Source;
    GE::AudioBuffer *m_Buffer;
    GE::AudioBufferPlayInstance *m_Effect;
};

#endif // AUDIOOBJECT_H
